import http from "@/utils/http";

/**
 * 加入购物车
 * @param {{skuId:String,count:Number}} data 
 * @returns 
 */
export function addMemberCart(data) {
  return http({
    url: '/member/cart',
    method: 'POST',
    data
  })
}

/**
 * 购物车列表
 * @returns 
 */
export function getMemberCart() {
  return http({
    url: '/member/cart',
    method: 'GET'
  })
}

/**
 * 修改商品选中状态
 * @param {SKUID} id 
 * @param {{selected:Boolean ,count:Number}} data 
 * @returns 
 */
export function selectMemberCart(skuId, data) {
  return http({
    url: `/member/cart/${skuId}`,
    method: 'PUT',
    data
  })
}